'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.home.index);
  //登录
  router.post('/api/login', controller.login.Login);
  //注册
  router.post('/api/regsiter', controller.login.Regsiter);
  //list 页面
  router.get('/api/list', controller.home.List);
  //科普搜索
  router.post('/api/listsearch', controller.home.Listsearch);
  //首页
  router.get('/api/homelist', controller.home.Homelist);
  //shop 页面，
  router.get('/api/shoplist', controller.home.Shoplist);
  //购物车页面，
  router.post('/shopcarlist', controller.home.shopcarlist);
  //添加到购物车，
  router.post('/addcar', controller.home.addcar);
  //删除，
  router.post('/delcar', controller.home.delcar);
  //++ --
  router.post('/changecar', controller.home.changecar);
  // router.post('/exitflag', controller.home.exitflag);
  // router.post('/checkall', controller.home.checkall);
  //添加到购物车，
  router.post('/addpayment', controller.home.addpayment);

  router.post('/orderlist', controller.home.orderlist);

  router.post('/api/address', controller.home.address);
  //支付
  router.post('/api/ali', controller.pay.alipay);


};
